home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19941221-19950208 / 000450_news@columbia.edu_Tue Feb 7 17:20:03 1995.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Received: from apakabar.cc.columbia.edu by watsun.cc.columbia.edu with SMTP id AA22008
  2.   (5.65c+CU/IDA-1.4.4/HLK for <kermit.misc@watsun.cc.columbia.edu>); Tue, 7 Feb 1995 12:20:24 -0500
  3. Received: by apakabar.cc.columbia.edu id AA03810
  4.   (5.65c+CU/IDA-1.4.4/HLK for kermit.misc@watsun); Tue, 7 Feb 1995 12:20:19 -0500
  5. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  6. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  7. Newsgroups: comp.protocols.kermit.misc
  8. Subject: Re: C-kermit maximum wait time
  9. Date: 7 Feb 1995 17:20:03 GMT
  10. Organization: Columbia University
  11. Lines: 27
  12. Message-Id: <3h8a43$3m5@apakabar.cc.columbia.edu>
  13. References: <3h63lo$svd@nuhou.aloha.net>
  14. Nntp-Posting-Host: watsun.cc.columbia.edu
  15. Apparently-To: kermit.misc@watsun.cc.columbia.edu
  16.  
  17. In article <3h63lo$svd@nuhou.aloha.net>,
  18. Timothy Newsham <newsham@hookomo.aloha.net> wrote:
  19. >I have a script that waits for input on the serial line,
  20. >writes to a file, runs a program, then sends output.  The program
  21. >needs to wait for long periods of time sometimes.   What is
  22. >the maximum value I can use to wait with?  It seems that
  23. >the program breaks out of the wait after about a day or so
  24. >with the current values I'm using.
  25. >
  26. It depends on "sizeof int" in the C compiler that generated your
  27. version of C-Kermit.  The INPUT timeout is a signed integer, so
  28. the maximum value would be two raised to the <number-of-bits-in-
  29. an-integer>'th power, minus 1.  So for 16-bit integers, it would
  30. be 65535 seconds, which is indeed only about 76% of a day.  For
  31. 32-bit integers, of course, the maximum timeout would be way bigger.
  32.  
  33. >Since I quit if the wait
  34. >fails the script stops running.   (The reason I quit if the
  35. >wait fails is so that a ^C at the console will kill the script,
  36. >otherwise the only way I have of killing the script is sending
  37. >a shutdown command over the serial line).
  38. >
  39. There's always a way.  For example, you could simply make a loop
  40. that executes infinitely, and waits for an hour, or 12 hours, or
  41. whatever, until the input arrives.
  42.  
  43. - Frank